package com.sunwhite.easycoding.demo1;

/**
 * 位移运算测试
 */
public class Demo1 {
  public static void main(String[] args) {
    //
      int a=35;
      int i = a << 1;
      int i1 = a >> 1;
      System.out.println("35向左位移1位"+i);
      System.out.println("35向右位移1位"+i1);
    System.out.println("--------------------------");
      int a2=-35;
      int i2 = a2 << 1;
      int i22 = a2 >> 1;
      System.out.println("-35向左位移1位"+i2);
      System.out.println("-35向右位移1位"+i22);
      System.out.println("--------------------------");

      int b=99;
      int j = b << 1;
      int j1 = b >> 1;
      System.out.println("99向左位移1位"+j);
      System.out.println("99向右位移1位"+j1);
      System.out.println("--------------------------");
      int b2=-99;
      int j2 = b2 << 1;
      int j12 = b2 >> 1;
      System.out.println("-99向左位移1位"+j2);
      System.out.println("-99向右位移1位"+j12);

      int k=1;
      if (true&false){
      System.out.println("1");
      }
      else{
      System.out.println("0");
      }
  }
}
